from odoo import models, _


class ProductAttribute(models.Model):
    _inherit = 'product.attribute'

    def write(self, vals):
        if not self.user_has_groups('sb_engineering.group_shy_engineering_manager'):
            raise models.ValidationError(_('You are not allowed to change this record.'))
        return super(ProductAttribute, self).write(vals)
